/*
 * Copyright (C) 2025 Holaf
 * Holaf Utilities - Image Viewer Stylesheet
 * MODIFICATION: Remplacement de CSS Grid par Flexbox pour la galerie afin de corriger un bug de rendu persistant.
 * CORRECTION: Padding déplacé du conteneur central vers la galerie pour permettre à la vue agrandie de remplir l'espace.
 * MODIFICATION: Added styles for Display Options panel and thumbnail fit toggle.
 * CORRECTION: Fixed a CSS syntax error that was preventing the thumbnail fit toggle from working.
 * MODIFICATION: Added styles for thumbnail size slider and used CSS variable for dynamic sizing.
 * MODIFICATION: Added styles for action buttons and thumbnail checkboxes.
 * MODIFICATION: Redesigned left panel layout for fixed and scrollable sections.
 * MODIFICATION: Refined date range layout for label/input alignment.
 * CORRECTION: Fixed right column layout and edit icon styling.
 * MODIFICATION: Made UI more compact by reducing margins, gaps, and title font sizes.
 * CORRECTION: Fixed missing scrollbar on the right info pane when the editor is open.
 * MODIFICATION: Added a loading overlay effect for non-blocking filter changes.
 * MODIFICATION: Added fade-in/out transitions for differential gallery rendering.
 */

#holaf-viewer-panel .holaf-viewer-container {
    /* --holaf-thumbnail-size is set by JS */
    --holaf-thumbnail-size: 150px;
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: var(--holaf-text-primary);
    background-color: var(--holaf-background-primary);
}

#holaf-viewer-panel .holaf-viewer-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#holaf-viewer-left-pane {
    flex: 0 0 220px;
    padding: 10px;
    border-right: 1px solid var(--holaf-border-color);
    background-color: var(--holaf-background-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.holaf-viewer-scrollable-section {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 50px;
    padding-right: 5px;
    margin-right: -5px;
}

.holaf-viewer-fixed-sections {
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid var(--holaf-border-color);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* MODIFIED: was 20px */
}

.holaf-viewer-filter-group {
    margin-bottom: 12px;
    /* MODIFIED: was 20px */
}

.holaf-viewer-fixed-sections .holaf-viewer-filter-group,
.holaf-viewer-fixed-sections .holaf-viewer-actions-group,
.holaf-viewer-fixed-sections .holaf-viewer-display-options {
    margin-bottom: 0;
}

.holaf-viewer-filter-group h4 {
    margin: 0 0 8px 0;
    /* MODIFIED: was 10px */
    color: var(--holaf-text-primary);
    border-bottom: 1px solid var(--holaf-border-color);
    padding-bottom: 4px;
    /* MODIFIED: was 5px */
    font-size: 13px;
    /* MODIFIED: was 14px */
}

/* CORRECTIF: Cible le titre 'Filters' (qui est le seul enfant de son groupe) pour corriger sa position. */
.holaf-viewer-filter-group h4:only-child {
    border-bottom: none;
    margin-bottom: 0;
}

.holaf-viewer-filter-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.holaf-viewer-filter-item {
    display: flex;
    align-items: center;
    gap: 4px;
    /* MODIFIED: was 8px for compactness */
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.holaf-viewer-filter-item input[type="checkbox"]:disabled+label {
    color: var(--holaf-text-secondary);
    cursor: not-allowed;
}

.holaf-viewer-date-range-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.holaf-viewer-date-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.holaf-viewer-date-input-group label {
    font-size: 13px;
    color: var(--holaf-text-secondary);
    flex-shrink: 0;
}

.holaf-viewer-date-input-group input[type="date"] {
    flex-grow: 0;
    background-color: var(--holaf-input-background);
    border: 1px solid var(--holaf-border-color);
    color: var(--holaf-text-primary);
    border-radius: 3px;
    padding: 4px;
    font-size: 12px;
    width: 125px;
    box-sizing: border-box;
}

.holaf-viewer-trash-separator {
    height: 1px;
    background-color: var(--holaf-border-color);
    margin: 10px 0;
}

.holaf-viewer-filter-item input[type="checkbox"] {
    accent-color: var(--holaf-accent-color);
    cursor: pointer;
    margin-left: 0;
    /* MODIFIED: Reset margin for compactness */
    margin-right: 0;
}

.holaf-viewer-actions-group h4 {
    margin: 0 0 8px 0;
    /* MODIFIED: was 10px */
    color: var(--holaf-text-primary);
    border-bottom: 1px solid var(--holaf-border-color);
    padding-bottom: 4px;
    /* MODIFIED: was 5px */
    font-size: 13px;
    /* MODIFIED: was 14px */
}

.holaf-viewer-actions-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.holaf-viewer-action-button-row {
    display: flex;
    gap: 5px;
}

.holaf-viewer-action-button {
    flex: 1;
    background-color: var(--holaf-button-background);
    color: var(--holaf-button-text);
    border: 1px solid var(--holaf-border-color);
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}

.holaf-viewer-action-button:hover:not(:disabled) {
    opacity: 0.9;
}

.holaf-viewer-action-button:active:not(:disabled) {
    opacity: 0.8;
}

.holaf-viewer-action-button:disabled {
    background-color: var(--holaf-background-secondary);
    color: var(--holaf-text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

#holaf-viewer-btn-delete:not(:disabled) {
    background-color: #c04040;
    border-color: #a03030;
}

#holaf-viewer-btn-delete:hover:not(:disabled) {
    background-color: #d05050;
    opacity: 1;
}

#holaf-viewer-btn-restore:not(:disabled) {
    background-color: #40a060;
    border-color: #308050;
}

#holaf-viewer-btn-restore:hover:not(:disabled) {
    background-color: #50b070;
    opacity: 1;
}

.holaf-viewer-display-options h4 {
    margin: 0 0 8px 0;
    /* MODIFIED: was 10px */
    color: var(--holaf-text-primary);
    font-size: 13px;
    /* MODIFIED: was 14px */
}

.holaf-viewer-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 10px;
}

.holaf-viewer-slider-container input[type="range"] {
    flex-grow: 1;
    accent-color: var(--holaf-accent-color);
}

.holaf-viewer-slider-container span {
    min-width: 40px;
    text-align: right;
    font-family: monospace;
    color: var(--holaf-text-secondary);
}

#holaf-viewer-center-pane {
    flex: 1 1 auto;
    position: relative;
}

#holaf-viewer-toolbar {
    padding: 0 10px 10px 10px;
    border-bottom: 1px solid var(--holaf-border-color);
    margin-bottom: 10px;
    flex-shrink: 0;
}

#holaf-viewer-gallery {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    /* Needed for the ::before overlay */
}

/* --- MODIFICATION START: Loading Overlay --- */
#holaf-viewer-gallery.loading-overlay {
    pointer-events: none;
    /* Prevent clicks during load */
    user-select: none;
}

#holaf-viewer-gallery.loading-overlay::before {
    content: 'Loading...';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--holaf-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    z-index: 20;
    /* Ensure it's on top of thumbnails */
    border-radius: 4px;
    transition: opacity 0.15s ease-in-out;
    opacity: 1;
}

/* --- MODIFICATION END --- */


.holaf-viewer-message {
    width: 100%;
    text-align: center;
    color: var(--holaf-text-secondary);
    font-style: italic;
    padding: 20px;
}

.holaf-viewer-thumbnail-placeholder {
    flex-basis: var(--holaf-thumbnail-size);
    /* CORRECTIF : Empêche les miniatures de grandir pour remplir l'espace. */
    flex-grow: 0;
    max-width: calc(var(--holaf-thumbnail-size) * 1.8);
    position: relative;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.3s ease-out, transform 0.3s ease-out;
    background-color: var(--holaf-input-background);
}

/* --- MODIFICATION START: Styles for gallery diffing animations --- */
.holaf-viewer-thumbnail-placeholder.entering {
    opacity: 0;
    transform: scale(0.9);
}

.holaf-viewer-thumbnail-placeholder.exiting {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    /* Prevent interaction during exit animation */
}

/* --- MODIFICATION END --- */

.holaf-viewer-thumbnail-placeholder:hover {
    border-color: var(--holaf-accent-color);
}

.holaf-viewer-thumbnail-placeholder.active {
    border-color: var(--holaf-accent-color);
    box-shadow: 0 0 8px var(--holaf-accent-color);
}

.holaf-viewer-thumbnail-placeholder.error {
    background-color: #5a2d2d;
    color: #ff8f8f;
    font-weight: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
}

.holaf-viewer-error-overlay {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 8px;
    max-height: 100px;
    overflow-y: auto;
    word-break: break-word;
}

.holaf-viewer-retry-button {
    background-color: #ff8f8f;
    color: #5a2d2d;
    border: 1px solid #ffc2c2;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.holaf-viewer-retry-button:hover {
    background-color: #ffffff;
}

.holaf-viewer-thumbnail-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.holaf-viewer-thumb-checkbox {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 6;
    transform: scale(1.1);
    accent-color: var(--holaf-accent-color);
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.holaf-viewer-thumbnail-placeholder:hover .holaf-viewer-thumb-checkbox,
.holaf-viewer-thumbnail-placeholder:has(> .holaf-viewer-thumb-checkbox:checked) .holaf-viewer-thumb-checkbox {
    opacity: 1;
}

.holaf-viewer-thumb-checkbox:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

#holaf-viewer-gallery.contain-thumbnails .holaf-viewer-thumbnail-placeholder img {
    object-fit: contain;
}

.holaf-viewer-fullscreen-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 5;
}

.holaf-viewer-thumbnail-placeholder:hover .holaf-viewer-fullscreen-icon {
    opacity: 1;
}


#holaf-viewer-zoom-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--holaf-background-primary);
    z-index: 10;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#holaf-viewer-zoom-view img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.2s ease-out;
    transform-origin: top left;
}

.holaf-viewer-zoom-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 12;
}

.holaf-viewer-zoom-fullscreen-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 12;
    transition: background-color 0.2s;
}

.holaf-viewer-zoom-fullscreen-icon:hover {
    background-color: rgba(30, 30, 30, 0.8);
}

/* --- MODIFICATION START: Styles for right column layout and editor --- */
#holaf-viewer-right-column {
    flex: 0 0 300px;
    border-left: 1px solid var(--holaf-border-color);
    background-color: var(--holaf-background-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#holaf-viewer-right-pane {
    flex: 1 1 0;
    /* MODIFIED: was '1 1 auto' */
    padding: 10px;
    overflow-y: auto;
    min-height: 0;
    /* Prevents flexbox overflow issue */
}

#holaf-viewer-editor-pane {
    flex-shrink: 0;
    /* Prevents the editor panel from shrinking */
    padding: 10px;
    border-top: 1px solid var(--holaf-border-color);
    background-color: var(--holaf-background-primary);
}

#holaf-viewer-right-pane h4,
#holaf-viewer-editor-pane h4 {
    margin: 0 0 8px 0;
    /* MODIFIED: was 10px */
    padding-bottom: 4px;
    /* MODIFIED: was 5px */
    border-bottom: 1px solid var(--holaf-border-color);
    font-size: 13px;
    /* MODIFIED */
}

/* --- END RIGHT COLUMN LAYOUT --- */

#holaf-viewer-info-content p {
    margin: 0 0 5px 0;
    /* MODIFIED: was 8px */
    font-size: 13px;
    color: var(--holaf-text-secondary);
    word-break: break-all;
}

#holaf-viewer-info-content p strong {
    color: var(--holaf-text-primary);
}

.holaf-viewer-metadata-label {
    font-weight: bold;
    color: var(--holaf-text-primary);
}

.holaf-viewer-metadata-source {
    font-size: 0.85em;
    font-style: italic;
    color: var(--holaf-text-secondary);
    margin-left: 5px;
}

#holaf-viewer-info-content hr {
    border-color: var(--holaf-border-color);
    opacity: 0.5;
    margin: 10px 0;
    /* MODIFIED: was 15px */
}

.holaf-viewer-info-actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.holaf-viewer-info-button {
    flex: 1;
    background-color: var(--holaf-input-background);
    border: 1px solid var(--holaf-border-color);
    color: var(--holaf-text-secondary);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.holaf-viewer-info-button:hover:not(:disabled) {
    background-color: var(--holaf-accent-color);
    border-color: var(--holaf-accent-color);
    color: var(--holaf-button-text);
}

.holaf-viewer-info-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.holaf-viewer-metadata-box {
    background-color: var(--holaf-input-background);
    border: 1px solid var(--holaf-border-color);
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 140px;
    /* MODIFIED: was 250px */
    overflow-y: auto;
    color: var(--holaf-text-primary);
}

/* --- START EDITOR STYLES --- */
#holaf-editor-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* MODIFIED: was 10px */
}

.holaf-editor-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid var(--holaf-border-color);
}

.holaf-editor-tab {
    padding: 6px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    background-color: transparent;
    color: var(--holaf-text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.holaf-editor-tab:hover:not(:disabled) {
    color: var(--holaf-text-primary);
}

.holaf-editor-tab.active {
    color: var(--holaf-accent-color);
    border-bottom-color: var(--holaf-accent-color);
    font-weight: bold;
}

.holaf-editor-tab:disabled {
    color: var(--holaf-text-secondary);
    opacity: 0.4;
    cursor: not-allowed;
}

.holaf-editor-tab-content {
    padding: 8px 0;
    /* MODIFIED: was 10px */
}

.holaf-editor-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* MODIFIED: was 12px */
}

.holaf-editor-slider-container {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.holaf-editor-slider-container label {
    text-align: right;
    color: var(--holaf-text-secondary);
}

.holaf-editor-slider-container input[type="range"] {
    width: 100%;
    accent-color: var(--holaf-accent-color);
}

.holaf-editor-slider-value {
    font-family: monospace;
    color: var(--holaf-text-primary);
    text-align: right;
}

.holaf-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    /* MODIFIED: was 10px */
    border-top: 1px solid var(--holaf-border-color);
    padding-top: 8px;
    /* MODIFIED: was 10px */
}

/* --- END EDITOR STYLES --- */

#holaf-viewer-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

#holaf-viewer-fullscreen-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    transform-origin: top left;
}

.holaf-viewer-fs-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(30, 30, 30, 0.7);
    color: white;
    border: 1px solid #555;
    border-radius: 50%;
    font-size: 24px;
    line-height: 38px;
    z-index: 10;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.holaf-viewer-fs-close:hover {
    transform: scale(1.1);
}

.holaf-viewer-fs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    z-index: 10;
    background: rgba(30, 30, 30, 0.5);
    color: white;
    border: none;
    font-size: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    user-select: none;
}

.holaf-viewer-fs-nav:hover {
    background: rgba(50, 50, 50, 0.8);
}

#holaf-viewer-fs-prev {
    left: 15px;
    border-radius: 0 10px 10px 0;
}

#holaf-viewer-fs-next {
    right: 15px;
    border-radius: 10px 0 0 10px;
}

#holaf-viewer-statusbar {
    flex-shrink: 0;
    padding: 5px 10px;
    border-top: 1px solid var(--holaf-border-color);
    background-color: var(--holaf-background-primary);
    font-size: 12px;
    color: var(--holaf-text-secondary);
    text-align: right;
}

#holaf-viewer-scrollable-section::-webkit-scrollbar,
#holaf-viewer-gallery::-webkit-scrollbar,
#holaf-viewer-right-pane::-webkit-scrollbar,
#holaf-viewer-editor-pane::-webkit-scrollbar,
.holaf-viewer-metadata-box::-webkit-scrollbar {
    width: 8px;
}

#holaf-viewer-scrollable-section::-webkit-scrollbar-track,
#holaf-viewer-gallery::-webkit-scrollbar-track,
#holaf-viewer-right-pane::-webkit-scrollbar-track,
#holaf-viewer-editor-pane::-webkit-scrollbar-track,
.holaf-viewer-metadata-box::-webkit-scrollbar-track {
    background: var(--holaf-scrollbar-track);
}

#holaf-viewer-scrollable-section::-webkit-scrollbar-thumb,
#holaf-viewer-gallery::-webkit-scrollbar-thumb,
#holaf-viewer-right-pane::-webkit-scrollbar-thumb,
#holaf-viewer-editor-pane::-webkit-scrollbar-thumb,
.holaf-viewer-metadata-box::-webkit-scrollbar-thumb {
    background-color: var(--holaf-scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--holaf-scrollbar-track);
}

#holaf-viewer-export-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

#holaf-viewer-export-dialog {
    background-color: var(--holaf-background-secondary);
    color: var(--holaf-text-primary);
    border: 1px solid var(--holaf-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 90%;
}

.holaf-viewer-export-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--holaf-border-color);
    font-size: 16px;
    font-weight: bold;
}

.holaf-viewer-export-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.holaf-viewer-export-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.holaf-viewer-export-option-group label {
    font-weight: bold;
    color: var(--holaf-text-secondary);
    font-size: 13px;
}

.holaf-viewer-export-option-group .holaf-export-choices {
    display: flex;
    gap: 15px;
    padding-left: 5px;
}

.holaf-viewer-export-option-group input[type="radio"],
.holaf-viewer-export-option-group input[type="checkbox"] {
    margin-right: 5px;
    accent-color: var(--holaf-accent-color);
}

.holaf-viewer-export-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid var(--holaf-border-color);
}

.holaf-viewer-search-bar {
    width: 100%;
    padding: 6px 8px;
    background-color: var(--holaf-input-background);
    border: 1px solid var(--holaf-border-color);
    color: var(--holaf-text-primary);
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 12px;
    /* MODIFIED: was 20px */
}

.holaf-viewer-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--holaf-border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.holaf-viewer-filter-header h4 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.holaf-viewer-folder-actions {
    font-size: 11px;
}

.holaf-viewer-folder-actions a {
    color: var(--holaf-text-secondary);
    text-decoration: none;
    padding: 2px 4px;
}

.holaf-viewer-folder-actions a:hover {
    color: var(--holaf-accent-color);
    text-decoration: underline;
}

.holaf-folder-separator {
    color: var(--holaf-border-color);
    margin: 0 2px;
}

.holaf-viewer-toggle-button-group {
    display: flex;
    gap: 8px;
}

.holaf-viewer-toggle-button {
    flex-grow: 1;
    padding: 6px 10px;
    border: 1px solid var(--holaf-border-color);
    background-color: var(--holaf-input-background);
    color: var(--holaf-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.holaf-viewer-toggle-button:hover {
    border-color: var(--holaf-text-secondary);
}

.holaf-viewer-toggle-button.active {
    background-color: var(--holaf-accent-color);
    color: var(--holaf-button-text);
    border-color: var(--holaf-accent-color);
    font-weight: bold;
}

/* --- START EDIT ICON STYLES (CORRECTED) --- */
.holaf-viewer-edit-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    background-color: transparent;
    /* MODIFIED: was rgba(0, 0, 0, 0.6) */
    color: var(--holaf-text-primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    z-index: 5;
}

.holaf-viewer-thumbnail-placeholder:hover .holaf-viewer-edit-icon,
.holaf-viewer-edit-icon.active {
    opacity: 1;
}

.holaf-viewer-edit-icon.active {
    color: var(--holaf-accent-color);
}


/* --- END EDIT ICON STYLES --- */

/* --- START FOLDER LOCK STYLES (SVG VERSION) --- */
.holaf-folder-lock-icon {
    text-decoration: none;
    color: var(--holaf-text-secondary);
    opacity: 0.3;
    /* Visible but faded when unlocked */
    transition: opacity 0.2s, color 0.2s;
    cursor: pointer;
    display: flex;
    /* Helps with vertical alignment */
    align-items: center;
}

.holaf-folder-lock-icon svg {
    vertical-align: middle;
    /* Better alignment with text */
}

.holaf-viewer-filter-item:hover .holaf-folder-lock-icon {
    opacity: 1;
}

.holaf-folder-lock-icon.locked {
    opacity: 1;
    color: var(--holaf-accent-color);
}

/* --- END FOLDER LOCK STYLES --- */